package com.runoob;

public class ObserverPatternDemo {
    public static void main(String[] args) {
        Subject subject = new Subject();

        // 注册观察者
        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);

        System.out.println("第一次状态变化: 15");
        subject.setState(15);
        System.out.println("第二次状态变化: 10");
        subject.setState(10);
    }
}